1. Field of the Invention
The present invention relates to a system, a controller, and a method thereof for transmitting a data stream, and particularly, to a system, a controller, and a method thereof for transmitting a data stream from a host to a peripheral device with a chip.
2. Description of Related Art
Digital cameras, cellular phones, and MP3 players have grown rapidly in recent years, which result in a rapid increase in demand of storage media by users. For the advantages of non-volatility, power saving, small dimension, and having no mechanical structure, the flash memories are very suitable to be embedded in various portable multimedia devices as described above.
On the other hand, the user's increasing acceptance of electronic wallet and prepayment has resulted in increasing popularization of smart cards. The smart card is typically an integrated circuit (IC) chip which includes, for example, a microprocessor, a card operation system, a security module, and a memory module to allow predetermined operation performed by an owner of the smart card. With the ability to provide computing, encryption, bidirectional communication and security functions, the smart card not only stores data, but also protects the data stored therein. One exemplary smart card is the subscriber identification module (SIM) of cellular phones that use global system for mobile communication (GSM). However, the smart card has a limit in its storage capacity. Thus, the smart card has recently begun to be used in combination with a large storage memory card to expand the storage capacity of the smart card.
Conventionally, in use of the smart card in combination with a flash memory, a particular command is used to differentiate the data transmitted to the smart card from the data transmitted to the flash memory. This particular command may not be supported by the hardware or the driver. Moreover, in the related art, information of the particular command, which regards the type of the transmitted data stream, is compared to determine whether the transmitted data stream is of the command format of the smart card. However, this method often results in confusion of the command data of the smart card with the normal data (i.e., misinterpreting the normal data as the command data of the smart card).
In addition, in utilization of electronic products with a cache, due to the electronic products' own limits, data stream transmission between the smart card and the electronic products can not bypass the cache, which makes a response message generated by the smart card unable to be inerrably transmitted back to the electronic product that the smart card is attached to, thereby restraining the applications of the smart card on such electronic product having a cache. For example, in a cell phone with a Java system, since the Java system does not support commands, e.g. the command of NO Cache, that allows the direct access to the flash memory without using the cache, it can be difficult to combine the smart card and the flash memory into a memory card in the cell phone with the Java system. FIG. 1 is a functional block diagram of a host 10 equipped with a memory card 12. Referring to FIG. 1, the host 10 is a type of electronic product (e.g., a cell phone with a Java system) and has a cache 14. The memory card 12 includes a flash memory 16 and a smart card chip 18. All data between the host 10 and the memory 12 is transmitted through the cache 14. However, since the cache 14 temporarily stores recent data transmitted between the host 10 and the memory card 12, when the host 10 acquires data from the smart card chip 18, if the cache 14 already contains data matched with the address designated by the read command, the cache 14 will transmit the matched data to the host 10. However, in such a system, the response message of the smart card chip 18 may be often substituted by the data already existing in the cache 14, which significantly affects the encryption and security communication of the smart card chip 18.
Therefore, a system and a method that can inerrably transmit the response message of the smart card are required in the relevant utilization of the smart card.